package day8.lambda.demo1;

public class test
{
    public static void main(String[] args)
    {
//        Swim s1=new Swim()
//        {
//            @Override
//            public void swimming()
//            {
//                System.out.println("游得快");
//            }
//        };
//      s1.swimmming();
        Swim s1=()->System.out.println("游得快");//重写更方便了



        Swim s2=()->System.out.println("hello");


        s1.swimming();


    }
}
@FunctionalInterface//标识符，说明是函数式接口

interface Swim
{
    public abstract void swimming();
}
